<!DOCTYPE html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Captive</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>


<script>

	var init = 5;
	
	$(document).ready(
		function() {
			document.getElementById("dialog").style.display="inherit";
			document.getElementById("background").style.display="inherit";
			document.getElementById("dialog").innerHTML = "I say: <br/>Jimmy, I'm sorry. Please forgive me for...neglecting you. I care about you. I do. Now I just want to get you to safety first.";
			$("#dialog").click(dialog1);
		}
	);
	
	function dialog1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>I guess...I can forgive you.";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2);
		}
	}
	
	function dialog2()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stranger takes over the phone and says: <br/>HEY! Do you want to see your son alive or not? Bring the money and meet me at Ferst Harbor in a hour. <br/> Don't call the police, or you will never see your son again!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_1);
		}
	}
	
	function dialog2_1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy shouts in the background: <br/>Stephen, what are you doing??!! (I hear fighting in the background) Dad, help me!! DAD!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_2);
		}
	}
	
	function dialog2_2()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "I shout: <br/>JIMMY!!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_3);
		}
	}
	
	function dialog2_3()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Stephen/Kidnapper hangs up the phone)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2_4);
		}
	}
	
	function dialog2_4()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "No!! Jimmy!! Why did Jimmy sound like he knows the kidnapper? <br/>What should I do now??";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog3);
		}
	}
	
	function dialog3()
	{
		document.getElementById("dialog").innerHTML = "<div onclick=\"dialog8()\">1. Call the police to help you rescue Jimmy</div><div onclick=\"dialog9()\">2. Rescue Jimmy on your own</div>";
		$("#dialog").unbind('click');
	}
	
	function dialog8()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "(Dialing)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog8_1);
		}
	}
	
	function dialog8_1()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I say: <br/>Is it 911? My son has been kidnapped!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(end1);
		}
	}
	
	function dialog9()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "Jimmy, please be okay. God...please help us...";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(end2);
		}
	}
	
	function end1()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene1);
	}
	
	function end2()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene2);
	}
	
	function nextscene1()
	{
			window.location = "scene2-1.php";
	}
	
	function nextscene2()
	{
			window.location = "scene2-2.php";
	}
	
</script>



</head>

<body>


<div id="container">
	<div id="background"><img src="images/office.jpg" /></div>
	<div id="dialog">
	</div>
	<div id="people"><img id="peopleimage" src=""></div>
</div>




</body>
</html>